<?php

namespace app\api\controller\hotel;


use think\Hook;
use app\api\controller\hotel\Token;

/**
 * 获取数据
 */
class Info extends Base
{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    
    protected $domain = 'https://cysms.wuuxiang.com/';
    
    protected $accessid = '1962a00cd74e4375a2454e4877b4c30b';
   
    protected $granttype = 'client';
    protected $token = '';
    protected $centerId = '177495';


    public function _initialize()
    {
        parent::_initialize();
        $token_obj = new Token();
        $this->token = $token_obj->getToken();
        $this->header = ['access_token:'.$this->token,'accessid:'.$this->accessid,'granttype:'.$this->granttype];
    }
    
    /**
     * 查询门店基本档案信息
     */
    public function getshops(){
        $this->table  = 'hotel_cy_shops';
        $this->url = $this->domain .'api/datatransfer/getshops?';
        
        $this->request_data = ['centerId'=>$this->centerId,'pageNo'=>1,'pageSize'=>10];
        $flag = $this->commonDealData('shopList');
        if($flag === true)$this->success ('成功');
        else $this->error ($flag);
    }
    
    
    /**
     * 账单明细查询
     * 查询账单明细数据
     */
    public function getserialdata(){
        $this->table  = 'hotel_cy_serialdata';
        $this->url = $this->domain .'api/datatransfer/getserialdata?';
        
        $this->request_data = ['settleDate'=>'2023-11-17','shopId'=>'177495','centerId'=>$this->centerId,'pageNo'=>1,'pageSize'=>10];
        $flag = $this->commonDealData('billList');
        if($flag === true)$this->success ('成功');
        else $this->error ($flag);
    }
   
       

    
}
